<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 1. 我想记录 这个属性 被修改过几次，每次修改的值是什么
        var obj;
        var arr = [];
       (function(){
         var _name = null;
         obj = Object.create({},{
                name:{
                    get:function(){
                        return _name;
                    },
                    set:function(v){
                        // 记录修改属性
                        arr.push(v);
                       _name = "《" + v + "》"; 
                    }
                }
            }) 
       })();
       obj.name = "三国演义";
       console.log(obj.name);
       obj.name = "水浒传";
       console.log(obj.name);
       obj.name = "红楼梦";
       console.log(obj.name);
       obj.name = "西游记";
       console.log(obj.name);

       console.log(obj);

       //记录了所有 修改过的值
       console.log(arr);


    </script>
</body>
</html>